package com.czr.controller.blog;

import com.czr.service.blog.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Description:
 * Author: czr czr
 * Version: 1.0
 * Create Date Time: 2021/11/19 9:28.
 * Update Date Time:
 *
 * @see
 */
@Controller
public class BlogEetailController {

    @Autowired
    private BlogService blogService;

    @GetMapping("/api/detail/{id}")
    public String blogLoad(Model model, @PathVariable("id") Integer id){
        model.addAttribute("blog", blogService.getById(id));
        return "blog/detail";
    }



}
